# Maintainer: Tom Gundersen <teg@jklm.no>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
# Contributor:  Mantas Mikulėnas <grawity@gmail.com>

pkgname=gummiboot
pkgver=48
pkgrel=1
pkgdesc="Simple UEFI Boot Manager"
url="http://freedesktop.org/wiki/Software/gummiboot"
arch=('x86_64')
license=('LGPL2.1')
makedepends=('gnu-efi-libs' 'docbook-xsl' 'git')
depends=('util-linux')
conflicts=('gummiboot-efi')
provides=('gummiboot-efi')
replaces=('gummiboot-efi')
options=('!strip' '!makeflags')
source=("git://anongit.freedesktop.org/$pkgname#tag=$pkgver"
        'loader.conf'
        'arch.conf'
        'splash-arch.bmp')
install=gummiboot.install
md5sums=('SKIP'
         '6ea803e5179d623716e3be0b636de658'
         '82bda9612e3a361a74cf8de2a0134b15'
         '1e2f9a8b0fa32022bf0a8f39123e5f4e')

build() {
	cd ${srcdir}/${pkgname}

	./autogen.sh
	./configure --sysconfdir=/etc  --with-efi-ldsdir=/usr/lib --libexecdir=/usr/lib --libdir=/usr/lib
	
	make
}

package() {
	## Install gummiboot example configuration files (can go away with systemd's kernel-install)
	install -D -m0644 "${srcdir}/loader.conf" "${pkgdir}/usr/lib/gummiboot/loader/loader.conf"
	install -D -m0644 "${srcdir}/arch.conf" "${pkgdir}/usr/lib/gummiboot/loader/entries/arch.conf"

	## ship an Arch Linux boot splash (still has to be dropped in manually to take effect)
	install -D -m0644 "${srcdir}/splash-arch.bmp" "${pkgdir}/usr/lib/gummiboot/splash-arch.bmp"

	cd ${srcdir}/${pkgname}

	make DESTDIR="${pkgdir}" install
}
